package dht.message;

import java.io.Serializable;
import java.net.InetAddress;

import dht.data.Contexte;

public class ContexteMessage extends Message implements Serializable {

	private static final long serialVersionUID = -6748338660071466009L;
	private Contexte contexte;

	public ContexteMessage(InetAddress adresseIpexp, Contexte contexte) {
		
		super(adresseIpexp, null, null); // Communication point a point, pas de vid ni de point dest
		this.TYPE_MSG = CONTEXTE_Message;
		this.contexte = contexte;
	}
	
	public ContexteMessage ReplyContexte(InetAddress adresseIpExp, Contexte contexte) {

			ContexteMessage c = new ContexteMessage(adresseIpExp, contexte);
			c.TYPE_MSG = Message.REPLY_Message;
			return c;
	}
	
	public Contexte getContexte() {
		return contexte;
	}
}
